package com.oauth.components.client.ui.gadgets;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.oauth.components.client.ui.CommonResources;

public class LoadingPanel extends Composite {

	private static LoadingPanelUiBinder uiBinder = GWT.create(LoadingPanelUiBinder.class);

	interface LoadingPanelUiBinder extends UiBinder<Widget, LoadingPanel> {
	}

	@UiField
	SimplePanel loadingPanel;

	@UiField
	Image loadingImage;

	public LoadingPanel() {
		initWidget(uiBinder.createAndBindUi(this));
		loadingImage.setResource(CommonResources.INSTANCE.loading());
		loadingPanel.addStyleName(CommonResources.INSTANCE.css().align_center());
	}

	public String getImageUrl() {
		return loadingImage.getUrl();
	}

	public void setImageUrl(String pImageUrl) {
		loadingImage.setUrl(pImageUrl);
	}
}
